/*
 * Jamus
 * Copyright (C) 2010 Jamus Team
 *
 * Jamus is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Jamus is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Jamus.  If not, see <http://www.gnu.org/licenses/>.
 */

/*
 * QTrackListAdaptor.h
 *
 *  Created on: Feb 3, 2010
 *      Author: christian moellinger
 */

#ifndef QTRACKLISTADAPTOR_H_
#define QTRACKLISTADAPTOR_H_
#include <QtDBus>
#include <iostream>
#include <boost/thread.hpp>
#include <log4cxx/logger.h>
#include "QFunctionWrapper.h"

using namespace std;

class QTrackListAdaptor: public QDBusAbstractAdaptor
{
    Q_OBJECT
    Q_CLASSINFO("D-Bus Interface", "org.freedesktop.MediaPlayer")
private:
    log4cxx::LoggerPtr logger;
    backend::Plugin &backend;
    boost::mutex mutex;
public:
    QTrackListAdaptor(QObject *parent);

public slots:
	int AddTrack(QString, bool);
	void DelTrack(int);
	int GetCurrentTrack();
	int GetLength();
	QVariantMap GetMetadata(int);
	void SetLoop(bool);
	void SetRandom(bool);
signals:
    void TrackListChange(int);
};

#endif /* QTRACKLISTADAPTOR_H_ */
